package com.tbit.uqbike.client.constant.enums;

/**
 * @Author: chen
 * @Description: 自定义需要拦截的接口，方法
 * @Date: 创建于 14:19 2019/12/27
 */
public enum TimeTransType {

    TYPE1("java.util.List", "com.tbit.uq.factorytest.pojo.MachineModel", "com.tbit.uq.factorytest.dao.main.MachineModelMapper.queryPage");

    private String returnType;

    private String resultMap;

    private String methodPathName;

    TimeTransType(String returnType, String resultMap, String methodPathName) {
        this.returnType = returnType;
        this.resultMap = resultMap;
        this.methodPathName = methodPathName;
    }

    public static TimeTransType find(String returnType, String resultMap, String methodPathName) {
        for (TimeTransType timeTransType : TimeTransType.values()) {
            if (timeTransType.returnType.equals(returnType)
                    && timeTransType.resultMap.equals(resultMap)) {
                if ("*".equals(timeTransType.methodPathName)
                        || timeTransType.methodPathName.equals(methodPathName)) {
                    return timeTransType;
                }
            }

        }
        return null;
    }

    public String getReturnType() {
        return returnType;
    }

    public void setReturnType(String returnType) {
        this.returnType = returnType;
    }

    public String getResultMap() {
        return resultMap;
    }

    public void setResultMap(String resultMap) {
        this.resultMap = resultMap;
    }

    public String getMethodPathName() {
        return methodPathName;
    }

    public void setMethodPathName(String methodPathName) {
        this.methodPathName = methodPathName;
    }
}
